package cn.lhn.ridersclub.handler;

import cn.lhn.ridersclub.dto.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class RCExceptionHandler {

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Result<?> exception(Exception e) {
        e.printStackTrace();
        return Result.error().message(e.getMessage());
    }
}
